/**
* 代码为自动生成 Created by www.magicalcoder.com
* 如果你改变了此类 read 请将此行删除
* 欢迎加入官方QQ群:323237052
*/

layui.config({base : "assets/"}).extend({"iotequipmentcollection_config":"admin/iotequipmentcollection/iotequipmentcollection-config","magicalcoderlist" : "magicalcoder/v001/rmp/magicalcoderlist"})
layui.use(["magicalcoderlist","iotequipmentcollection_config"],function(){
    var config = $.extend(layui.iotequipmentcollection_config,{
        childrenPage:[
            {
                tabTitle:"设备采集点",
                url:"admin/page/iot_collection_point/list",
                mcForeignName:"equipmentCollectionId"
            }        ],
        layTable : {
            //表格内容
            elem : '#newsList',
            id : "newsListTable"
            },
            //排序跟数据库实际字段名的映射
        sortMap:{
            equipmentCollectionId:'equipment_collection_id',equipmentId:'equipment_id',collectionModeId:'collection_mode_id',collectionIp:'collection_ip',equipmentCollectionStatus:'equipment_collection_status',equipmentCollectionType:'equipment_collection_type',remarks:'remarks',creationTime:'creation_time',creationUser:'creation_user'
        }
    });
    var  magicalcoderlist = layui.magicalcoderlist(config);
    //绑定所有查询区域控件
    magicalcoderlist.bindQueryArea();
    //表格
    var cols = [[
        {type: "checkbox", fixed:"left", width:50},
                {field: 'equipmentCollectionId', title: '设备采集方式ID', minWidth:100, align:"center",sort:true},
            {field: 'equipmentId', title: '设备ID',minWidth:350, align:'center', templet:'#equipmentIdTemplate',sort:true},
            {field: 'collectionModeId', title: '采集方式ID',minWidth:350, align:'center', templet:'#collectionModeIdTemplate',sort:true},

            {field: 'collectionIp', title: '采集IP', minWidth:200,templet:function (d) {
                    return '<input type="text" value="'+ magicalcoderlist.escapeHTML(d.collectionIp) +'" class="magicalcoder-table-text layui-input security_list_table_form_collectionIp" name="collectionIp" data-identify="'+d.equipmentCollectionId+'" lay-verify="magicalCoderVerify" magicalcoder-verify=""  placeholder="采集IP"/>'
                }
                , sort:true
            },

            {field: 'equipmentCollectionStatus', title: '设备采集方式状态', minWidth:200,templet:function (d) {
                    return '<input type="text" value="'+ magicalcoderlist.escapeHTML(d.equipmentCollectionStatus) +'" class="magicalcoder-table-text layui-input security_list_table_form_equipmentCollectionStatus" name="equipmentCollectionStatus" data-identify="'+d.equipmentCollectionId+'" lay-verify="magicalCoderVerify" magicalcoder-verify=""  placeholder="设备采集方式状态"/>'
                }
                , sort:true
            },

            {field: 'equipmentCollectionType', title: '设备采集方式类型', minWidth:200,templet:function (d) {
                    return '<input type="text" value="'+ magicalcoderlist.escapeHTML(d.equipmentCollectionType) +'" class="magicalcoder-table-text layui-input security_list_table_form_equipmentCollectionType" name="equipmentCollectionType" data-identify="'+d.equipmentCollectionId+'" lay-verify="magicalCoderVerify" magicalcoder-verify=""  placeholder="设备采集方式类型"/>'
                }
                , sort:true
            },

            {field: 'remarks', title: '备注', minWidth:200,templet:function (d) {
                    return '<input type="text" value="'+ magicalcoderlist.escapeHTML(d.remarks) +'" class="magicalcoder-table-text layui-input security_list_table_form_remarks" name="remarks" data-identify="'+d.equipmentCollectionId+'" lay-verify="magicalCoderVerify" magicalcoder-verify=""  placeholder="备注"/>'
                }
                , sort:true
            },

            {field: 'creationTime', title: '创建时间', minWidth:200,templet:function (d) {
                    return '<input type="text" value="'+ magicalcoderlist.escapeHTML(d.creationTime) +'" class="magicalcoder-table-text layui-input security_list_table_form_creationTime" name="creationTime" data-identify="'+d.equipmentCollectionId+'" lay-verify="magicalCoderVerify" magicalcoder-verify=""  placeholder="创建时间"/>'
                }
                , sort:true
            },

            {field: 'creationUser', title: '创建人', minWidth:200,templet:function (d) {
                    return '<input type="text" value="'+ magicalcoderlist.escapeHTML(d.creationUser) +'" class="magicalcoder-table-text layui-input security_list_table_form_creationUser" name="creationUser" data-identify="'+d.equipmentCollectionId+'" lay-verify="magicalCoderVerify" magicalcoder-verify=""  placeholder="创建人"/>'
                }
                , sort:true
            },
        {title: '操作', minWidth:250, templet:'#newsListOperateTemplate',fixed:"right",align:"center"}
    ]];
    //表格中的一些事件
    var tableEvent = {
        "tool":function (obj,roleId) {//操作部分的按钮
            return true;//不阻止事件继续执行封装的事件
        },
        "sort":function (obj,safeOrderBy) {//排序
            return true;//不阻止事件继续执行封装的事件
        }
    }
    magicalcoderlist.bindTableArea(cols,tableEvent)
    magicalcoderlist.bindAreaEvents();
})
